Skip to content

1.10.0#277

Merged
digitalghost-dev merged 22 commits intomainfrom
1.10.0
Apr 29, 2026
Merged

1.10.0#277
digitalghost-dev merged 22 commits intomainfrom
1.10.0

Conversation

@digitalghost-dev
Copy link
Copy Markdown
Owner

@digitalghost-dev digitalghost-dev commented Apr 29, 2026

Summary by CodeRabbit

  • New Features

    • Berry command now accepts direct berry name arguments and displays results in an improved two-panel layout.
    • Added support for Pokémon cry data in API responses.
  • Bug Fixes

    • Improved error handling in types, abilities, and Pokémon commands.
  • Documentation

    • Updated Docker image examples and badges to v1.10.0.
  • Tests

    • Expanded test coverage for data extraction pipelines and notification sensors.

This was linked to issues Apr 29, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 29, 2026

📝 Walkthrough

Walkthrough

This PR bumps the project version from v1.9.4 to v1.10.0 across build configs and documentation, updates the Go toolchain from 1.25.8 to 1.25.9, refactors the berry command to support direct CLI arguments with a new two-panel layout, improves error handling throughout multiple commands and flags, and expands test coverage with new pricing extraction, series validation, and Dagster sensor tests plus golden output fixtures.

Changes

Cohort / File(s) Summary
Version and Toolchain Bumps
.github/workflows/ci.yml, .goreleaser.yml, Dockerfile, go.mod, nfpm.yaml, README.md, card_data/pyproject.toml, web/pyproject.toml, card_data/pipelines/poke_cli_dbt/dbt_project.yml, testdata/main_latest_flag.golden
Updated VERSION_NUMBER and embedded main.version from v1.9.4 to v1.10.0; incremented Go toolchain from 1.25.8 to 1.25.9 in CI, Dockerfile, and go.mod; updated README Docker image tags and package version metadata accordingly.
Berry Command Enhancements
cmd/berry/berry.go, cmd/berry/berry_test.go, cmd/berry/berryinfo.go, cmd/berry/berryinfo_test.go
Added CLI argument support to bypass interactive table flow; refactored berry accessor functions from exported to unexported; introduced new berryContainers helper for two-panel layout rendering and berryExists validation function; added golden-file regression tests and invalid-berry error handling tests.
Error Handling Improvements
cmd/types/damage_table.go, cmd/types/damage_table_test.go, cmd/types/types.go, flags/pokemonflagset.go, flags/abilityflagset.go, flags/abilityflagset_test.go
Updated DamageTable to return error instead of discarding API failures; modified type and ability command flows to capture and propagate errors immediately; removed redundant API calls; added test coverage for error cases and missing type/ability scenarios.
Data Structure and Minor Updates
structs/structs.go, cmd/card/cardinfo.go, cmd/pokemon/render_test.go, .gitignore
Added Cries field to PokemonJSONStruct; updated CardImage error message for invalid URLs; reformatted test struct literals; extended .gitignore to exclude VERSION file, version-bump.sh script, and testing cache directories.
New Test Coverage
card_data/pipelines/tests/extract_pricing_test.py, card_data/pipelines/tests/extract_series_test.py, card_data/pipelines/tests/sensors_test.py, card_data/pyproject.toml
Added comprehensive pytest suite for TCGCSV pricing extraction pipeline covering parsing helpers and product information pulling; added validation tests for series extraction edge cases; introduced Dagster sensor tests for discord success/failure notifications; added pytest-cov dependency for coverage reporting.
Berry Golden Test Fixtures
testdata/berry_aguav.golden, testdata/berry_cheri.golden, testdata/berry_chople.golden, testdata/berry_oran.golden, testdata/berry_sitrus.golden
Added golden-file snapshots for berry command output rendering, containing ASCII/Unicode box-formatted displays of berry properties and effects for regression testing.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • 1.8.6 #232 — Both PRs perform identical version bumps across CI, GoReleaser, Dockerfile, nfpm, and README for the same release cycle.
  • 1.7.4 #200 — Both PRs modify the same build and versioning artifacts (VERSION_NUMBER, ldflags, Go toolchain, packaging config) in parallel fashion.
  • 1.7.1 #189 — The PR's new pricing extraction tests directly exercise functions and behavior introduced in that earlier PR.

Poem

🐰 From nine to ten, we hop along,
With golden berries, fixtures strong!
Errors caught, containers tall,
Tests that cover one and all!
Version bumped, toolchains bright—
hops away into the night

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title '1.10.0' is a version number that reflects the core objective of this changeset—bumping the project version from v1.9.4 to v1.10.0 across all configuration files, CI/CD workflows, and documentation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 1.10.0

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 29, 2026

Merging this PR will not alter performance

✅ 12 untouched benchmarks
🆕 41 new benchmarks
⏩ 10 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
🆕 test_extract_card_name_dash_and_variant_suffix N/A 55.3 µs N/A
🆕 test_pull_product_information_skips_non_cards N/A 3.2 ms N/A
🆕 test_extract_card_name_accented_characters N/A 59.4 µs N/A
🆕 test_build_dataframe_raises_on_empty_dataframe N/A 122.2 ms N/A
🆕 test_extract_series_data_all_filtered_out N/A 123.7 ms N/A
🆕 test_pull_product_information_success N/A 3.3 ms N/A
🆕 test_pull_product_information_skips_variants N/A 3.3 ms N/A
🆕 test_extract_card_name_plain N/A 56.7 µs N/A
🆕 test_build_dataframe_concatenates_all_sets N/A 124.8 ms N/A
🆕 test_extract_series_data_validation_error N/A 123.4 ms N/A
🆕 test_pull_product_information_sm_normalizes_card_number N/A 3.2 ms N/A
🆕 test_is_card_empty_extended_data N/A 22.8 µs N/A
🆕 test_extract_series_data_http_error N/A 123.4 ms N/A
🆕 test_extract_card_name_strip_dash_variant N/A 56.6 µs N/A
🆕 test_extract_card_name_strip_secret N/A 58.2 µs N/A
🆕 test_extract_card_name_strip_full_art N/A 58.5 µs N/A
🆕 test_get_card_number_found N/A 20.2 µs N/A
🆕 test_extract_card_name_strip_gold N/A 55.9 µs N/A
🆕 test_extract_card_name_strip_reverse_holofoil N/A 57.3 µs N/A
🆕 test_discord_failure_sensor_posts_webhook N/A 277.7 µs N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.


Comparing 1.10.0 (1e28f38) with main (a935015)2

Open in CodSpeed

Footnotes

  1. 10 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (1fd0d05) during the generation of this report, so a935015 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 11

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
cmd/berry/berryinfo.go (1)

124-133: ⚠️ Potential issue | 🟠 Major

Add timeout and HTTP status validation for image fetches.

On line 124, http.Get has no timeout, which can hang the CLI indefinitely. Additionally, the response status code is not validated, so HTTP errors (4xx, 5xx) would incorrectly be reported as decode errors on line 132.

Suggested fix
 import (
 	"image"
 	"net/http"
 	"strings"
+	"time"
@@
-	imageResp, err := http.Get(berryImage[0])
+	client := &http.Client{Timeout: 10 * time.Second}
+	imageResp, err := client.Get(berryImage[0])
 	if err != nil {
 		return "Error downloading berry image"
 	}
 	defer imageResp.Body.Close()
+	if imageResp.StatusCode != http.StatusOK {
+		return "Error downloading berry image"
+	}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/berry/berryinfo.go` around lines 124 - 133, Replace the plain http.Get
call used to fetch berryImage[0] with an http.Client that has a timeout (e.g.,
time.Second * N) and use client.Get instead; after the GET, check for a non-nil
imageResp and validate imageResp.StatusCode is 2xx (return an error message
including the status code/body when not), then defer imageResp.Body.Close() only
after confirming imageResp is non-nil, and only call imaging.Decode on
imageResp.Body if the status check passed so HTTP errors aren’t misreported as
decode errors.
🧹 Nitpick comments (6)
cmd/berry/berryinfo_test.go (1)

105-129: TestBerryImageWithMockServer doesn’t exercise the mock server path.

On Line 120 and Line 126, both inputs return early ("Image information not available"), so no HTTP request is made. Consider renaming this test to an error-path test or wiring DB data to hit the mock URL.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/berry/berryinfo_test.go` around lines 105 - 129,
TestBerryImageWithMockServer never hits the mock HTTP server because
berryImage("NonExistentBerry") and berryImage("") return the error path; either
rename the test to reflect it only verifies the error path (e.g.,
TestBerryImage_ErrorPath) or modify the test to exercise the mock server by
wiring the code that resolves image URLs to point at server.URL (for example by
populating the in-memory DB/lookup used by berryImage or setting the
resolver/env var it uses) and also ensure the mock handler actually writes image
bytes (use png.Encode on the image before w.Write) so a real HTTP fetch
succeeds; update the test to call berryImage with the berry name/key that maps
to server.URL so the mock path is exercised.
cmd/berry/berry_test.go (1)

269-279: Prefer t.Setenv over manual set/unset for test env state.

This simplifies cleanup and restores any previous value automatically.

Suggested refactor
-	err := os.Setenv("GO_TESTING", "1")
-	if err != nil {
-		t.Fatalf("Failed to set GO_TESTING env var: %v", err)
-	}
-
-	defer func() {
-		err := os.Unsetenv("GO_TESTING")
-		if err != nil {
-			t.Logf("Warning: failed to unset GO_TESTING: %v", err)
-		}
-	}()
+	t.Setenv("GO_TESTING", "1")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/berry/berry_test.go` around lines 269 - 279, The test currently calls
os.Setenv("GO_TESTING","1") and defers os.Unsetenv, which should be replaced
with t.Setenv to automatically restore prior state; update the test to remove
the os.Setenv/os.Unsetenv calls and call t.Setenv("GO_TESTING", "1") (using the
test's *testing.T instance `t`) in the setup so cleanup is handled for you.
structs/structs.go (1)

145-148: Add a focused unmarshalling test for Cries fields.

Since this new field powers --cry, add a PokemonApiCall test assertion for Cries.Latest/Cries.Legacy to prevent silent schema regressions.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@structs/structs.go` around lines 145 - 148, Add a focused unit test that
unmarshals a sample JSON containing the Cries object and asserts Cries.Latest
and Cries.Legacy values to prevent schema regressions; specifically create or
extend the PokemonApiCall test to unmarshal into the Cries struct (type Cries)
and include assertions that compare the expected strings to the unmarshalled
Cries.Latest and Cries.Legacy fields so the test fails if those keys are missing
or renamed.
flags/cry.go (1)

34-38: HTTP GET lacks timeout, risking indefinite hang.

http.Get uses the default client with no timeout. If the cry URL server is slow or unresponsive, this could hang indefinitely.

♻️ Add a timeout
-	resp, err := http.Get(cryURL)
+	client := &http.Client{Timeout: 15 * time.Second}
+	resp, err := client.Get(cryURL)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@flags/cry.go` around lines 34 - 38, The HTTP GET to cryURL uses http.Get (the
default client) with no timeout; replace it with a request that has a timeout to
avoid hanging. Create an http.Client with a sensible Timeout (e.g.,
&http.Client{Timeout: 10 * time.Second}) and use client.Get(cryURL) or build the
request with context.WithTimeout and http.NewRequestWithContext, handle the
error as before, and defer resp.Body.Close() after ensuring resp is non-nil;
update imports (time or context) and adjust the call sites around cryURL
accordingly.
card_data/pyproject.toml (2)

3-3: Non-standard Python version format.

The v prefix in version "v1.10.0" doesn't conform to PEP 440. While pip may tolerate this, some tools and registries may have issues. Consider using "1.10.0" for consistency with Python packaging standards.

♻️ Suggested fix
-version = "v1.10.0"
+version = "1.10.0"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@card_data/pyproject.toml` at line 3, The version string in pyproject.toml
uses a non-PEP 440 format ("v1.10.0"); update the value to a PEP 440-compliant
string (remove the "v") so it reads "1.10.0" to avoid tooling/registry
problems—edit the version = "v1.10.0" entry in pyproject.toml to version =
"1.10.0".

22-22: pytest-cov belongs in dev dependencies, not main dependencies.

pytest-cov is a testing tool and should be in the [dependency-groups] dev section alongside pytest (line 35), not in the main dependencies list. Adding it to runtime dependencies unnecessarily bloats production installs.

♻️ Move to dev group
     "pydantic==2.11.7",
-    "pytest-cov==7.1.0",
     "requests==2.32.4",

Then add to the dev group:

[dependency-groups]
dev = [
    ...
    "pytest==9.0.2",
    "pytest-cov==7.1.0",
    ...
]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@card_data/pyproject.toml` at line 22, Remove "pytest-cov==7.1.0" from the
main dependencies list in pyproject.toml and add it to the dev dependency group
alongside pytest (i.e., the [dependency-groups] dev section), ensuring the entry
name matches the existing style ("pytest-cov==7.1.0") so it is only installed
for development/testing and not at runtime.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@card_data/pipelines/poke_cli_dbt/dbt_project.yml`:
- Line 2: The dbt_project.yml uses a non-compliant version string "v1.10.0";
update the version key value to plain SemVer by removing the leading "v" so it
reads 1.10.0 (i.e., change the version entry from 'v1.10.0' to '1.10.0') to
satisfy dbt's version format requirements.

In `@card_data/pipelines/tests/extract_pricing_test.py`:
- Line 22: The test incorrectly accesses a non-existent attribute path on the
Dagster asset by using build_dataframe.op.compute_fn.decorated_fn; remove that
invalid access and either call the asset directly (invoke build_dataframe() to
get its return value) or, if the asset needs a Dagster context, use Dagster
testing utilities such as build_asset_context() to call build_dataframe(context)
or dg.materialize_to_memory([build_dataframe]) for integration-style testing;
update the variable _build_dataframe_fn to use one of these valid invocation
approaches referencing the build_dataframe symbol.

In `@card_data/pipelines/tests/sensors_test.py`:
- Around line 12-13: Replace direct accesses to the private attribute
`_run_status_sensor_fn` for `discord_success_sensor` and
`discord_failure_sensor` with Dagster's public test helper: call
`build_run_status_sensor_context()` to create a run-status sensor context (use
ephemeral_instance=True or other options you need) and then invoke the sensor
with that context (e.g., call
`discord_success_sensor(build_run_status_sensor_context(...))` and
`discord_failure_sensor(build_run_status_sensor_context(...))`), asserting on
the returned sensor evaluation; this removes fragile private API usage and uses
Dagster's supported testing API.

In `@cmd/berry/berry_test.go`:
- Around line 319-323: The test currently discards the error return from
BerryCommand(); change the call to capture both output and err (e.g., output,
err := BerryCommand()), then assert the command succeeded before comparing
outputs by using t.Fatalf or assert.NoErrorf(t, err, "BerryCommand failed: %v",
err) (or assert.NoError) so failures in BerryCommand() are surfaced, and only
then strip ANSI and compare cleanOutput to tt.expectedOutput; reference
BerryCommand() and the test's output/cleanOutput variables when making the
change.

In `@cmd/berry/berry.go`:
- Around line 39-55: The direct-query branch currently checks len(os.Args) > 2
which allows extra positional args (e.g. "berry cheri extra"); change the logic
to require exactly one berry name by validating len(os.Args) == 3 (or reject
when len(os.Args) > 3) and/or tighten utils.ValidateArgs (set MaxArgs to 3
and/or RequireName true) so extra args are rejected; update the branch that
reads berryName (styling.CapitalizeResourceName(os.Args[2])) to only run when a
single name is provided, and return a formatted error via utils.FormatError when
extra positional arguments are present; keep calls to berryExists and
berryContainers unchanged.

In `@cmd/berry/berryinfo.go`:
- Around line 14-21: The function berryExists should not swallow database
errors; change berryExists to return (bool, error) instead of bool, have it call
connections.QueryBerryData(...) and return (len(results) > 0, err) so real DB
errors propagate, and update any callers to handle the error (e.g. check error
before assuming "not found"); reference the berryExists function and the
connections.QueryBerryData call when making the change.

In `@cmd/card/cardinfo.go`:
- Around line 84-87: The error handling around url.Parse(imageURL) should
distinguish parse failures from invalid schemes: if url.Parse returns an error
(err != nil) propagate or wrap that parse error (including err) rather than
returning the generic API message, and if parsing succeeds but parsedURL.Scheme
is not "http" or "https" return a more specific error (e.g., "invalid URL
scheme" and include parsedURL.Scheme or the original imageURL) so callers can
tell it's client-side URL validation; update the logic around parsedURL, err and
the returned errors accordingly.

In `@cmd/types/damage_table_test.go`:
- Around line 22-24: The test redirects os.Stdout before calling DamageTable but
uses t.Fatalf which can terminate the test before stdout is restored; to fix,
capture the original stdout (e.g., old := os.Stdout) and register a guaranteed
restore using t.Cleanup(func(){ os.Stdout = old }) (or defer immediately after
redirect) before invoking DamageTable so stdout is restored even on fatal paths;
update the test around the DamageTable("fire", "type") call to use this cleanup
and keep the existing failure assertion.

In `@flags/cry.go`:
- Line 29: The error string passed to cmdutils.FormatError in the return
statement currently concatenates "No cry available for"+pokemonName without a
space; update the return in the function that constructs this error (the line
using fmt.Errorf and cmdutils.FormatError) to include a space before the
pokemonName (e.g., "No cry available for " + pokemonName or use fmt.Sprintf) so
the message reads "No cry available for <pokemonName>" and keep using
FormatError and fmt.Errorf as before.
- Around line 50-62: The pcm allocation can panic if dec.Length() returns -1;
update the code around the pcm slice creation (symbols: dec.Length(),
dec.Channels(), pcm, dec.Read) to detect when dec.Length() < 0 and handle
unknown length by using a resizable approach (e.g., start with a safe initial
capacity and append reads or incrementally grow the buffer) instead of
allocating a fixed-size slice with a negative length; ensure the read loop still
uses dec.Read(pcm[read:]) style when length is known, and switches to
appending/expanding pcm when length is unknown so reads continue until io.EOF
without causing a negative-size panic.

In `@README.md`:
- Around line 102-103: Add a clear note to the Docker usage section (near the
docker run example for digitalghostdev/poke-cli:v1.10.0) stating that the --cry
flag is unavailable in the container because the image is built with -tags nocry
in the Dockerfile; update the docker command block and related Docker section
text (the paragraphs around the docker run example and the other referenced
Docker lines) to explicitly mention “--cry not supported in Docker images (built
with -tags nocry)” so users won’t expect in-container cry playback.

---

Outside diff comments:
In `@cmd/berry/berryinfo.go`:
- Around line 124-133: Replace the plain http.Get call used to fetch
berryImage[0] with an http.Client that has a timeout (e.g., time.Second * N) and
use client.Get instead; after the GET, check for a non-nil imageResp and
validate imageResp.StatusCode is 2xx (return an error message including the
status code/body when not), then defer imageResp.Body.Close() only after
confirming imageResp is non-nil, and only call imaging.Decode on imageResp.Body
if the status check passed so HTTP errors aren’t misreported as decode errors.

---

Nitpick comments:
In `@card_data/pyproject.toml`:
- Line 3: The version string in pyproject.toml uses a non-PEP 440 format
("v1.10.0"); update the value to a PEP 440-compliant string (remove the "v") so
it reads "1.10.0" to avoid tooling/registry problems—edit the version =
"v1.10.0" entry in pyproject.toml to version = "1.10.0".
- Line 22: Remove "pytest-cov==7.1.0" from the main dependencies list in
pyproject.toml and add it to the dev dependency group alongside pytest (i.e.,
the [dependency-groups] dev section), ensuring the entry name matches the
existing style ("pytest-cov==7.1.0") so it is only installed for
development/testing and not at runtime.

In `@cmd/berry/berry_test.go`:
- Around line 269-279: The test currently calls os.Setenv("GO_TESTING","1") and
defers os.Unsetenv, which should be replaced with t.Setenv to automatically
restore prior state; update the test to remove the os.Setenv/os.Unsetenv calls
and call t.Setenv("GO_TESTING", "1") (using the test's *testing.T instance `t`)
in the setup so cleanup is handled for you.

In `@cmd/berry/berryinfo_test.go`:
- Around line 105-129: TestBerryImageWithMockServer never hits the mock HTTP
server because berryImage("NonExistentBerry") and berryImage("") return the
error path; either rename the test to reflect it only verifies the error path
(e.g., TestBerryImage_ErrorPath) or modify the test to exercise the mock server
by wiring the code that resolves image URLs to point at server.URL (for example
by populating the in-memory DB/lookup used by berryImage or setting the
resolver/env var it uses) and also ensure the mock handler actually writes image
bytes (use png.Encode on the image before w.Write) so a real HTTP fetch
succeeds; update the test to call berryImage with the berry name/key that maps
to server.URL so the mock path is exercised.

In `@flags/cry.go`:
- Around line 34-38: The HTTP GET to cryURL uses http.Get (the default client)
with no timeout; replace it with a request that has a timeout to avoid hanging.
Create an http.Client with a sensible Timeout (e.g., &http.Client{Timeout: 10 *
time.Second}) and use client.Get(cryURL) or build the request with
context.WithTimeout and http.NewRequestWithContext, handle the error as before,
and defer resp.Body.Close() after ensuring resp is non-nil; update imports (time
or context) and adjust the call sites around cryURL accordingly.

In `@structs/structs.go`:
- Around line 145-148: Add a focused unit test that unmarshals a sample JSON
containing the Cries object and asserts Cries.Latest and Cries.Legacy values to
prevent schema regressions; specifically create or extend the PokemonApiCall
test to unmarshal into the Cries struct (type Cries) and include assertions that
compare the expected strings to the unmarshalled Cries.Latest and Cries.Legacy
fields so the test fails if those keys are missing or renamed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ba71fdd0-d43e-46db-8047-a4e9745882be

📥 Commits

Reviewing files that changed from the base of the PR and between 1fd0d05 and 2aa2c3a.

⛔ Files ignored due to path filters (2)
  • card_data/uv.lock is excluded by !**/*.lock
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (36)
  • .github/workflows/ci.yml
  • .gitignore
  • .goreleaser.yml
  • Dockerfile
  • README.md
  • card_data/pipelines/poke_cli_dbt/dbt_project.yml
  • card_data/pipelines/tests/extract_pricing_test.py
  • card_data/pipelines/tests/extract_series_test.py
  • card_data/pipelines/tests/sensors_test.py
  • card_data/pyproject.toml
  • cmd/berry/berry.go
  • cmd/berry/berry_test.go
  • cmd/berry/berryinfo.go
  • cmd/berry/berryinfo_test.go
  • cmd/card/cardinfo.go
  • cmd/pokemon/pokemon.go
  • cmd/pokemon/render_test.go
  • cmd/types/damage_table.go
  • cmd/types/damage_table_test.go
  • cmd/types/types.go
  • flags/abilityflagset.go
  • flags/abilityflagset_test.go
  • flags/cry.go
  • flags/cry_nocry.go
  • flags/cry_test.go
  • flags/pokemonflagset.go
  • go.mod
  • nfpm.yaml
  • structs/structs.go
  • testdata/berry_aguav.golden
  • testdata/berry_cheri.golden
  • testdata/berry_chople.golden
  • testdata/berry_oran.golden
  • testdata/berry_sitrus.golden
  • testdata/main_latest_flag.golden
  • web/pyproject.toml

Comment thread card_data/pipelines/poke_cli_dbt/dbt_project.yml
Comment thread card_data/pipelines/tests/extract_pricing_test.py Outdated
Comment thread card_data/pipelines/tests/sensors_test.py
Comment thread cmd/berry/berry_test.go Outdated
Comment thread cmd/berry/berry.go
Comment thread cmd/card/cardinfo.go
Comment thread cmd/types/damage_table_test.go
Comment thread flags/cry.go Outdated
Comment thread flags/cry.go Outdated
Comment thread README.md
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 73.80952% with 22 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
flags/pokemonflagset.go 48.14% 7 Missing and 7 partials ⚠️
cmd/berry/berry.go 85.29% 3 Missing and 2 partials ⚠️
cmd/types/types.go 0.00% 2 Missing ⚠️
cmd/card/cardinfo.go 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
cmd/berry/berryinfo.go 92.94% <100.00%> (+0.73%) ⬆️
cmd/types/damage_table.go 97.14% <100.00%> (+0.12%) ⬆️
flags/abilityflagset.go 60.00% <100.00%> (+2.42%) ⬆️
structs/structs.go 100.00% <ø> (ø)
cmd/card/cardinfo.go 76.92% <0.00%> (ø)
cmd/types/types.go 82.05% <0.00%> (-1.07%) ⬇️
cmd/berry/berry.go 64.46% <85.29%> (+7.15%) ⬆️
flags/pokemonflagset.go 72.44% <48.14%> (-2.50%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@digitalghost-dev digitalghost-dev linked an issue Apr 29, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
cmd/berry/berry.go (1)

39-45: ⚠️ Potential issue | 🟠 Major

Reject trailing positional args in direct-query mode.

Line 39 still allows four argv entries, and Line 44 still branches on len(os.Args) > 2, so berry cheri extra is accepted and silently ignores extra. Tighten this path so exactly one berry name is allowed.

Suggested fix
-	if err := utils.ValidateArgs(os.Args, utils.Validator{MaxArgs: 4, CmdName: "berry", RequireName: false, HasFlags: false}); err != nil {
+	if err := utils.ValidateArgs(os.Args, utils.Validator{MaxArgs: 3, CmdName: "berry", RequireName: false, HasFlags: false}); err != nil {
 		output.WriteString(err.Error())
 		return output.String(), err
 	}
 
-	if len(os.Args) > 2 {
+	if len(os.Args) == 3 {
 		berryName := styling.CapitalizeResourceName(os.Args[2])
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/berry/berry.go` around lines 39 - 45, The direct-query path currently
permits extra positional args; update the validator and branch to require
exactly one berry name: change the utils.ValidateArgs call to use
Validator{MaxArgs: 3, RequireName: true, CmdName: "berry", HasFlags: false} so
trailing args are rejected, and replace the branch condition from if
len(os.Args) > 2 to if len(os.Args) == 3 before calling
styling.CapitalizeResourceName(os.Args[2]) so only a single berry name is
accepted.
🧹 Nitpick comments (1)
card_data/pipelines/tests/extract_pricing_test.py (1)

1-4: Avoid mutating sys.path at module import time.

Line 4 prepends a dynamic path globally, which can leak across the test session and shadow installed modules. Prefer configuring test import roots in pyproject.toml/pytest.ini (e.g., pytest pythonpath) or using an installable package layout.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@card_data/pipelines/tests/extract_pricing_test.py` around lines 1 - 4, Remove
the top-level mutation of sys.path (the statement sys.path.insert(0,
str(Path(__file__).parent.parent.parent))) and instead either configure the test
import root via pytest (add pythonpath/settings in pytest.ini or pyproject.toml)
or, if a temporary path change is absolutely required for a specific test,
perform it locally inside that test using pytest's monkeypatch
(monkeypatch.syspath_prepend or monkeypatch.setitem on sys.path) so the change
is scoped to the test run rather than at module import time.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@cmd/berry/berry.go`:
- Around line 39-45: The direct-query path currently permits extra positional
args; update the validator and branch to require exactly one berry name: change
the utils.ValidateArgs call to use Validator{MaxArgs: 3, RequireName: true,
CmdName: "berry", HasFlags: false} so trailing args are rejected, and replace
the branch condition from if len(os.Args) > 2 to if len(os.Args) == 3 before
calling styling.CapitalizeResourceName(os.Args[2]) so only a single berry name
is accepted.

---

Nitpick comments:
In `@card_data/pipelines/tests/extract_pricing_test.py`:
- Around line 1-4: Remove the top-level mutation of sys.path (the statement
sys.path.insert(0, str(Path(__file__).parent.parent.parent))) and instead either
configure the test import root via pytest (add pythonpath/settings in pytest.ini
or pyproject.toml) or, if a temporary path change is absolutely required for a
specific test, perform it locally inside that test using pytest's monkeypatch
(monkeypatch.syspath_prepend or monkeypatch.setitem on sys.path) so the change
is scoped to the test run rather than at module import time.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d8e43b3e-bec8-44ec-bdbd-e344dcffa81e

📥 Commits

Reviewing files that changed from the base of the PR and between 2aa2c3a and 1e28f38.

⛔ Files ignored due to path filters (1)
  • card_data/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • .github/workflows/ci.yml
  • Dockerfile
  • card_data/pipelines/tests/extract_pricing_test.py
  • cmd/berry/berry.go
  • cmd/berry/berry_test.go
  • cmd/berry/berryinfo.go
  • flags/pokemonflagset.go
  • go.mod
✅ Files skipped from review due to trivial changes (2)
  • go.mod
  • Dockerfile
🚧 Files skipped from review as they are similar to previous changes (3)
  • cmd/berry/berry_test.go
  • .github/workflows/ci.yml
  • flags/pokemonflagset.go

@digitalghost-dev digitalghost-dev merged commit 702d173 into main Apr 29, 2026
11 checks passed
@digitalghost-dev digitalghost-dev deleted the 1.10.0 branch April 29, 2026 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant